package com.ruoyi.web.controller.system.biz;

import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.system.domain.WarnUserLogExcel;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.WarnUserLog;
import com.ruoyi.system.service.IWarnUserLogService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 【请填写功能名称】Controller
 *
 * @author ruoyi
 * @date 2025-06-14
 */
@RestController
@RequestMapping("/system/warn")
public class WarnUserLogController extends BaseController {
    @Autowired
    private IWarnUserLogService warnUserLogService;

    /**
     * 查询【请填写功能名称】列表
     */
//    @PreAuthorize("@ss.hasPermi('system:warn:list')")
    @GetMapping("/list")
    public TableDataInfo list(WarnUserLog warnUserLog) {
        startPage();
        List<WarnUserLog> list = warnUserLogService.selectWarnUserLogList(warnUserLog);
        return getDataTable(list);
    }

    @GetMapping("/statistics")
    public AjaxResult statistics(WarnUserLog warnUserLog) {
        Map<String, Object> result = warnUserLogService.selectWarnUserLogStatistics(warnUserLog);
        return AjaxResult.success(result);
    }

    /**
     * 导出【请填写功能名称】列表
     */
    @PostMapping("/export")
    public void export(HttpServletResponse response, @RequestBody WarnUserLog warnUserLog) {
        List<WarnUserLogExcel> list = warnUserLogService.selectWarnUserLogExcelList(warnUserLog);
        ExcelUtil<WarnUserLogExcel> util = new ExcelUtil<>(WarnUserLogExcel.class);
        util.exportExcel(response, list, "【请填写功能名称】数据");
    }
}
